﻿using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace Xioa_UI.Controls;

public class XioaCard : ContentControl
{
    public string Header
    {
        get { return (string)GetValue(HeaderProperty); }
        set { SetValue(HeaderProperty, value); }
    }

    public static readonly DependencyProperty HeaderProperty =
        DependencyProperty.Register(nameof(Header), typeof(string), typeof(XioaCard));

    public HorizontalAlignment HeaderHorizontalAlignment
    {
        get { return (HorizontalAlignment)GetValue(HeaderHorizontalAlignmentProperty); }
        set { SetValue(HeaderHorizontalAlignmentProperty, value); }
    }

    public static readonly DependencyProperty HeaderHorizontalAlignmentProperty =
        DependencyProperty.Register(nameof(HeaderHorizontalAlignment), typeof(HorizontalAlignment), typeof(XioaCard));

    public VerticalAlignment HeaderVerticalAlignment
    {
        get { return (VerticalAlignment)GetValue(HeaderVerticalAlignmentProperty); }
        set { SetValue(HeaderVerticalAlignmentProperty, value); }
    }

    public static readonly DependencyProperty HeaderVerticalAlignmentProperty =
        DependencyProperty.Register(nameof(HeaderVerticalAlignment), typeof(VerticalAlignment), typeof(XioaCard));

    public CornerRadius BorderCornerRadius
    {
        get => (CornerRadius)GetValue(BorderCornerRadiusProperty);
        set => SetValue(BorderCornerRadiusProperty, value);
    }

    public static readonly DependencyProperty BorderCornerRadiusProperty =
        ElementBase.Property<XioaCard, CornerRadius>(nameof(BorderCornerRadiusProperty), new CornerRadius(0));

    public double HeaderHeight
    {
        get => (double)GetValue(HeaderHeightProperty);
        set => SetValue(HeaderHeightProperty, value);
    }

    public static readonly DependencyProperty HeaderHeightProperty =
        ElementBase.Property<XioaCard, double>(nameof(HeaderHeightProperty), 50);

    public double HeaderFontSize
    {
        get => (double)GetValue(HeaderFontSizeProperty);
        set => SetValue(HeaderFontSizeProperty, value);
    }

    public static readonly DependencyProperty HeaderFontSizeProperty =
        ElementBase.Property<XioaCard, double>(nameof(HeaderFontSizeProperty), 10);

    public Thickness HeaderContentMargin
    {
        get => (Thickness)GetValue(HeaderContentMarginProperty);
        set => SetValue(HeaderContentMarginProperty, value);
    }

    public static readonly DependencyProperty HeaderContentMarginProperty =
        ElementBase.Property<XioaCard, Thickness>(nameof(HeaderContentMarginProperty), new Thickness(5));

    public double SeparatorSize
    {
        get => (double)GetValue(SeparatorSizeProperty);
        set => SetValue(SeparatorSizeProperty, value);
    }
    
    public static readonly DependencyProperty SeparatorSizeProperty =
        ElementBase.Property<XioaCard, double>(nameof(SeparatorSizeProperty), 1);

    public Brush HeaderBackground
    {
        get => (Brush)GetValue(HeaderBackgroundProperty);
        set => SetValue(HeaderBackgroundProperty, value);
    }
    
    public static readonly DependencyProperty HeaderBackgroundProperty =
        ElementBase.Property<XioaCard, Brush>(nameof(HeaderBackgroundProperty));

}